
#ifndef __REMOTE_RESOLVER_H
#define __REMOTE_RESOLVER_H

#include "Resolver.h"

/** A resolver class that queries a remote broker to resolve. */
class RemoteResolver : public Resolver
{
   public:
      RemoteResolver(KeyDB &ikeydb, 
         const char *ihostname, int iportno, const char *isender, const char *irecipient,
         apr_pool_t *imp);
      ~RemoteResolver();
      const char *get(const char *hierarchy);
      void renameActorID(const char *actorid, const char *actoralias);
   protected:
      int exchangeMessageToNameAndTypeResolve(const char *hierarchy);
      const char *resolveName(const char *hierarchy);
      const char *resolveType(const char *hierarchy);
      const char *resolveProgress(const char *hierarchy);
      const char *resolveMetadata(const char *parent, const char *suffix);
      const char *resolveParent(const char *parent, const char *suffix);
      const char *resolveChildren(const char *parent, const char *suffix);
      /** The key database containing keys to authenticate with the remote broker. */
      KeyDB *keydb;
      /** The hostname of the remote broker. */
      const char *hostname;
      /** The port number of the remote broker. */
      int portno;
      /** The actor ID of the sender of the messages requesting actor data. */ 
      const char *sender;
      /** The actor ID of the recipient fielding the actor data requests. */
      const char *recipient;
};

#endif
